package com.wwj.springboot.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author wwj
 */
@Data
@TableName(value = "cmfz_banner")
public class CmfzBanner implements Serializable {
    public static final String COL_BANNER_ID = "banner_id";
    public static final String COL_BANNER_IMAGE_URL = "banner_image_url";
    public static final String COL_BANNER_OLD_NAME = "banner_old_name";
    public static final String COL_BANNER_STATE = "banner_state";
    public static final String COL_BANNER_DATE = "banner_date";
    public static final String COL_BANNER_DESCRIPTION = "banner_description";
    @TableId(value = "banner_id", type = IdType.AUTO)
    @Excel(name = "轮播图编号")
    private Integer bannerId;
    @TableField(value = "banner_image_url")
    @Excel(name = "轮播图" ,imageType= 1 ,type = 2 ,width =  30,height = 30,
    savePath = "E:/IDEA/Idea_Work/myFile/")
    private String bannerImageUrl;
    /**
     * 原有名称
     */
    @Excel(name = "轮播图名字")
    @TableField(value = "banner_old_name")
    private String bannerOldName;
    @TableField(value = "banner_state")
    @Excel(name = "bannerState" ,replace = {"正常_0","冻结_1"})
    private Integer bannerState;
    /**
     * 上传时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
    @TableField(value = "banner_date")
    @Excel(name = "时间" ,format="yyyy-MM-dd HH:mm:ss")
    private Date bannerDate;
    @TableField(value = "banner_description")
    @Excel(name = "轮播图介绍" ,replace = {"正常_0","冻结_1"})
    private String bannerDescription;
}